/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.database.tablegroup;

import aiaudio.lastfm.hbase.CannotCreateTableException;
import aiaudio.database.DatabaseStorage;
import aiaudio.database.tables.TableStructure;
import java.io.IOException;

/**
 *
 * @author nastya
 */
public class InitialDataTableGroup extends TableGroup{

    private String usersTable = "users";
    private String artistsTable = "artists";
    private String ratingListTable = "ratings";
    private String dataMetricsTable = "data_metrics";
    private String timeMetricsTable = "time_metrics";
    private String socialLinkTable = "social_links";
    
    
    private InitialDataTableGroup() {
        super("", false);
    }

    public String getArtistsTable() {
        return artistsTable;
    }

    public String getDataMetricsTable() {
        return dataMetricsTable;
    }

    public String getRatingListTable() {
        return ratingListTable;
    }

    public String getTimeMetricsTable() {
        return timeMetricsTable;
    }

    public String getUsersTable() {
        return usersTable;
    }

    public String getSocialLinkTable() {
        return socialLinkTable;
    }

    public void setSocialLinkTable(String socialLinkTable) {
        this.socialLinkTable = socialLinkTable;
    }
        

    private static InitialDataTableGroup instance;

    public static InitialDataTableGroup getInstance() {
        if(instance == null){
            instance = new InitialDataTableGroup();
        }
        return instance;
    }

    
    
    
    @Override
    public void create(DatabaseStorage storage) throws CannotCreateTableException, IOException {
        createTable(storage, usersTable, TableStructure.UsersList);
        createTable(storage, artistsTable, TableStructure.ArtistList);
        createTable(storage, ratingListTable, TableStructure.RatingList);
        createTable(storage, dataMetricsTable, TableStructure.DataMetrics);
        createTable(storage, timeMetricsTable, TableStructure.TimeMetrics);
        createTable(storage, socialLinkTable, TableStructure.Social);
    }
}
